package cn.edu.scau.cmi.xianjiehua.spring.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ApplicationContextUtil {
	private volatile static ApplicationContext applicationContext;
	
	public static ApplicationContext getApplicationContext() {
		if(applicationContext == null) {
			synchronized(ApplicationContextUtil.class) {
				if(applicationContext == null) {
					applicationContext = new ClassPathXmlApplicationContext("cn/edu/scau/cmi/xianjiehua/spring/application-context.xml");
				}
			}
		}
		return applicationContext;
	}

}
